#!/usr/bin/env python
# -*- coding:utf-8 -*-
# @Time: 2022/12/27 19:29
# @Author: 周健
# @Email: 907614893@qq.com
# @File：classify_page.py
from selenium.webdriver.common.by import By
from pages.base_page import BasePage

class ClassifyPage(BasePage):
    homecook_locator = (By.XPATH,'//android.widget.ListView[@resource-id=\"com.gfeng.daydaycook:id/rightListView\"]/android.widget.LinearLayout[1]/android.widget.RelativeLayout[1]/android.widget.GridView[1]/android.widget.RelativeLayout[1]/android.widget.RelativeLayout[1]/android.widget.RelativeLayout[1]/android.widget.ImageView[1]')
    homecook_text_locator = (By.XPATH,'//android.widget.EditText[@resource-id=\"com.gfeng.daydaycook:id/searchEt\"]')

    # 点击家常菜
    def click_homecook(self):
        self.driver.find_element(*self.homecook_locator).click()
    # 获取家常菜列表搜索框内容
    def get_homecook_text(self):
        return self.driver.find_element(*self.homecook_text_locator).text




